package org.gd.science.qr.qrgen;

import net.glxn.qrgen.QRCode;
import net.glxn.qrgen.image.ImageType;

import java.io.*;

@Deprecated
public class QRCodeGenerator2 {

    private static final String text = "Hello QR World!";
    private static final ImageType imageType = ImageType.JPG;

    public static void main(String[] args) {
        try {
            ByteArrayOutputStream out = QRCode
                    .from(text)
                    //.withSize(500, 500)
                    .to(imageType)
                    .stream();
            FileOutputStream fout = new FileOutputStream(
                    new File("/home/user/QR_Code1." + imageType));
            fout.write(out.toByteArray());
            fout.flush();
            fout.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
